#include "BPECollisionWorldArea.h"

BPECollisionWorldArea::BPECollisionWorldArea(){
	xAreaCode = 0;
	yAreaCode = 0;
	zAreaCode = 0;
};

BPECollisionWorldArea::BPECollisionWorldArea(BPEPoint3d areaCode){
	xAreaCode = (int)areaCode.getX();
	yAreaCode = (int)areaCode.getY();
	zAreaCode = (int)areaCode.getZ();

	//(minx,miny,minz,maxx,maxy,maxz)
	cube = aabbox3d<f32>(	(xAreaCode) * cubeLineLength,
							(yAreaCode) * cubeLineLength,
							(zAreaCode) * cubeLineLength,
							(xAreaCode + 1) * cubeLineLength,
							(yAreaCode + 1) * cubeLineLength,
							(zAreaCode + 1) * cubeLineLength);

	
};


void BPECollisionWorldArea::addCollisionShapeCode(const int &i){
	
	collisionShapeCodes.push_back(i);
	
};
void BPECollisionWorldArea::removeCollisionShapeCode(const int &i){
	int size = collisionShapeCodes.size();
	for(int j = 0; j < size; j++){
	
		if( collisionShapeCodes[j] == i ){
			collisionShapeCodes.erase(collisionShapeCodes.begin() + j);
			return;
		}

	}
	
};

vector<int> BPECollisionWorldArea::getCollisionShapeCodes(){
	return collisionShapeCodes;	
};	
		